/*
** ---> This Test State is testing the following behaviours
** ---> Path following - LookWhereYoureGoing
**
** ---> Louie
*/

#ifndef TEST_STATE_2_H
#define TEST_STATE_2_H

#include "GameState.h"
#include "Singleton.h"
#include "GameCamera.h"

#include "Unit.h"
#include "Path.h"

#include "FollowPath.h"
#include "LookWhereYoureGoing.h"

class TestState3 : public Engine::GameState, public Engine::NonCopyable
{
	private:
		friend class Engine::Singleton <TestState3>;
		unsigned int m_hash;//hash stored once so it wont have to be calced each time 

		TestState3();

		Engine::Unit *m_target;
		Engine::Path p;

		Engine::FollowPath* sb_fap;
		Engine::LookWhereYoureGoing* sb_lwyg;

		Engine::Vec3 mouseToWorld;
		Engine::Vec3 rfar, rnear;
		bool isclick;

	public:
		//inherited from GameState
		const char* GetName() const {return "TestState3";}
		unsigned int GetHash() const {return m_hash;}
		void Activate();
		void Update();
		void Draw();
		void Deactivate();

		void OnKeyboardEvent(const SDL_KeyboardEvent& k);
		void OnMouseButtonEvent(const SDL_MouseButtonEvent& m);
		void OnQuit();

		Engine::Vec3 MouseToWorldCoords(int x, int y);

		void UpdatePath();
};

typedef Engine::Singleton <TestState3> TheTestState3;

#endif